package com.example.huawei;

import java.util.Scanner;

/**
 * 输入一个int型的正整数，计算出该int型数据在内存中存储时1的个数。
 * 10111  n
 * 00001
 * n&1 > 0  count++
 * n = n>>1
 *
 * @author mdl
 * @date 2020/4/21 22:00
 */
public class Test2 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int number = sc.nextInt();
            int count = 0;
            while (number > 0) {
                if ((number & 1) > 0) {
                    count++;
                }
                number = number >> 1;
            }
            System.out.println(count);
        }
        sc.close();
    }


}
